package org.jiuling.aliyun.oss.config;

import org.jiuling.aliyun.oss.client.enums.EndpointEnum;

/**
 * 阿里云Oss配置
 * @author 紫灵
 * @date 2022年10月09日 16时00分33秒
 */
public class AliYunOssConfig {

    /** 终端地址 */
    private EndpointEnum endpoint;
    /** 自定义域名 */
    private String endpointUrl;

    public EndpointEnum getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(EndpointEnum endpoint) {
        this.endpoint = endpoint;
    }

    public String getEndpointUrl() {
        return endpointUrl;
    }

    public void setEndpointUrl(String endpointUrl) {
        this.endpointUrl = endpointUrl;
    }

    /**
     * 建造者
     * @return 建造者
     */
    public static Builder builder(){
        return new Builder();
    }

    public static class Builder {

        /** 阿里云Oss配置 */
        private final AliYunOssConfig aliYunOssConfig;

        public Builder() {
            aliYunOssConfig = new AliYunOssConfig();
        }

        public Builder addEndpoint(EndpointEnum endpoint) {
            aliYunOssConfig.endpoint = endpoint;
            return this;
        }

        public Builder addEndpointUrl(String endpointUrl) {
            aliYunOssConfig.endpointUrl = endpointUrl;
            return this;
        }

        /**
         * 构建
         * @return 构建
         */
        public AliYunOssConfig build() {
            return aliYunOssConfig;
        }

    }
}
